package dyy.zc.campuspay.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import dyy.zc.campuspay.R;
import dyy.zc.campuspay.base.BaseActivity;
import dyy.zc.campuspay.bean.OrderInfo;
import dyy.zc.campuspay.utils.ImageLoaderUtils;
import dyy.zc.campuspay.views.CircleImageView;

public class BillDetailActivity extends BaseActivity {
    private TextView tvTitle;
    private CircleImageView head;
    private TextView name,price,payStyle,desc,date,orderNum;

    @Override
    protected void findViewByIDS() {
        tvTitle = findViewsById(R.id.top_tv_title);
        head = findViewsById(R.id.civ_userHead);
        name = findViewsById(R.id.tv_userName);
        price = findViewsById(R.id.tv_price);
        payStyle = findViewsById(R.id.tv_payStyle);
        desc = findViewsById(R.id.tv_miaoshu);
        date = findViewsById(R.id.tv_date);
        orderNum = findViewsById(R.id.tv_orderNum);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bill_detail);
        initData();
    }

    private void initData() {
        tvTitle.setText("账单详情");
        Intent intent =getIntent();
        if (intent !=null){
            Bundle bundle = intent.getExtras();
            if (bundle != null){
                OrderInfo orderInfo = (OrderInfo) bundle.get("order");
                ImageLoaderUtils.initImage(this,
                        loginuser.getHead().getFileUrl(), head, R.mipmap.ic_launcher);
                name.setText(loginuser.getNikeName());
                price.setText("¥ "+orderInfo.getPrice()+"");
                payStyle.setText(orderInfo.getPayStyle());
                desc.setText(orderInfo.getDescribe());
                date.setText(orderInfo.getCreatedAt());
                orderNum.setText(orderInfo.getOrderNum());
            }
        }
    }
}
